package com.ExceptionPWTest;

import java.io.FileOutputStream;

public class FinallyTest2 {
    public static void main(String[] args) {
        //放在小括号里的流会自动close
        System.out.println("程序开始");
        try(FileOutputStream fos = new FileOutputStream("./a/ss.txt");) {
            fos.write(65);
            System.out.println("1");
            return;

        }catch (Exception e ){
            System.out.println("异常");
        }finally {
            System.out.println("2");
        }

        System.out.println("程序结束");
    }
}
